<?php
namespace app\api\validate;

use think\Validate;

/**
 * 行为验证器
 * @package app\menus\validate
 * @author
 */
class Examine extends Validate
{
    //定义验证规则
    protected $rule = [
        'process_type|审批分类'  => 'require|number',
        'first_user_id|第一审批人'  => 'require|number',
        'content|OA内容'  => 'require',
        'start_time|开始时间'  => 'require',
        'end_time|结束时间'  => 'require',
        'duration|时长'  => 'require',
    ];
    //定义验证提示
    protected $message = [
        'process_type.require' => '请填写审批分类',
        'process_type.number' => '审批分类格式不正确',
        'first_user_id.require' => '请填写审批人',
        'first_user_id.number' => '审批人格式不正确',
        'content.require' => 'OA内容不能为空',
        'start_time.require' => '开始时间不能为空',
        'end_time.require' => '结束时间不能为空',
        'duration.require' => '时长不能为空',
    ];
    //定义验证场景
    protected $scene = [
        'add'   =>  ['process_type','first_user_id','content','start_time','end_time'],
        'save'   =>  ['evaluate','content','total_num','id'],
    ];
}
